<?php
require_once 'class/DataIn/AbstractDataIN.php';
require_once 'class/DataIn/AbstractDataIN.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Time
 *
 * @author mateusz.ledzewicz
 */
class Historical extends AbstractDataIN{
    protected $dataArray;
    
    public function __construct($isin, $date, $type, $numberOfData) {
        parent::__construct($isin, $date, $type, $numberOfData+3);
    }


    protected function prepareData() {
      
        $data = $this->getPreparedData();
        $count = count($data);
        var_dump($count);
        $this->dataArray = array_values($data);
        foreach($this->dataArray as $key => $line){
            if($key+3>=$count)
                break;
            
            $valueYesterday = $this->getValue($this->dataArray[$key+1]);
            $valueBeforeYesterday = $this->getValue($this->dataArray[$key+2]);
            $valueThird = $this->getValue($this->dataArray[$key+3]);
            $this->data[] = array($valueYesterday, $valueBeforeYesterday, $valueThird);  
        }   
        
    }
}

?>
